#pragma once
#include "ActionableObject.h"
#include "Item.h"
#include <string>
#include <iostream>
#include <vector>

ActionableObject::ActionableObject(Item interactingItem, std::string actionText)
{
    this->actionText = actionText;
    interactingItem = uniqueInteractingItem;
    currentState = &states[0];
}

void ActionableObject::doAction(Item actingItem)
{
    if(!actingItem.getName().compare(uniqueInteractingItem.getName()))
    {
        std::cout << "The " + actingItem.getName() + " is not the correct item to use with this " + getName() << std::endl;
    }
    else
    {
        std::cout << actionText << std::endl;
        changeState();
    }
}

void ActionableObject::changeState()
{
    if(currentState == &states[0])
    {
        currentState = &states[1];
    }
    else
    {
        currentState = &states[0];
    }
}

std::string* ActionableObject::getCurrentState()
{
    return currentState;
}

std::string ActionableObject::getName()
{
    return name;
}

ActionableObject::~ActionableObject()
{
    //dtor
}
